package com.lixin.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @TableName shop_order
 */
@TableName(value = "shop_order")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Order implements Serializable {
    @TableId
    private Long orderId;

    private String orderSerialNumber;

    private Long userId;

    private BigDecimal orderPaidPrice;

    private BigDecimal orderTotalPrice;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderCreated;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderUpdated;

    @Version
    @JsonIgnore
    private Integer orderVersion;

    @TableLogic
    @JsonIgnore
    private Integer orderDeleted;

    @Serial
    private static final long serialVersionUID = 1L;
}